<?php
	// Known download locations for java versions
	$locations['windows']['default'] = 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=12798';
	$locations['linux']['default'] = 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=12791';
	$locations['linux']['x86_64'] = 'http://javadl.sun.com/webapps/download/AutoDL?BundleId=12789';
	
	// Redirect to the correct download
	if (isset($locations[$_GET['os']])) {
		if (isset($locations[$_GET['os']][$_GET['version']])) {
			header('Location: '.$locations[$_GET['os']][$_GET['version']]);
		} else if (isset($locations[$_GET['os']]['default'])) {
			header('Location: '.$locations[$_GET['os']]['default']);
		}
	}
?>
